package top.healthylife.gateway.platformchain.api.black.personal.add;

import cn.hutool.core.bean.BeanUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import top.healthylife.gateway.core.service.ParentFace;
import top.healthylife.gateway.core.util.SystemConfigUtils;
import top.healthylife.gateway.dto.annotation.ApiServiceExplain;
import top.healthylife.gateway.platform.chain.dto.personal.add.req.ChainPersonalBlackListAddReqDto;
import top.healthylife.gateway.platform.chain.dto.personal.add.res.ChainPersonalBlackListAddResDto;
import top.healthylife.gateway.platformchain.api.config.SystemConfig;
import top.healthylife.gateway.platformchain.api.util.OutHttpUtil;

/**
 * @author : GaoZeXi
 * @date 2021/5/7 17:54
 */
@Slf4j
@Service
@ApiServiceExplain(price = 20, apiName = "个人黑名单-新增", info = "新增、修改链上数据时，需要调用端进行加密（签名）数据，保证数据的安全性。查询、返回值均暂不做加密处理。")
public class PersonalBlackListAddApi implements ParentFace<ChainPersonalBlackListAddReqDto, ChainPersonalBlackListAddResDto> {
    private static final String URL = OutHttpUtil.BASE_URL+"/bcapi/api/blacklist/addPersonal";

    @Override
    public ChainPersonalBlackListAddResDto execute(ChainPersonalBlackListAddReqDto reqDto) {
        //
        return OutHttpUtil.post(URL, BeanUtil.beanToMap(reqDto), (SystemConfig) SystemConfigUtils.get()
                , ChainPersonalBlackListAddResDto.class);

    }
}
